﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using loginSQL.Util;

namespace loginSQL.Pages
{
    public static class Constants
    {
        public static PointF pixelPerMili = new PointF(4.7f, 7.2f);
        public static PointF offsetMili = new PointF(0, -9);
        public static PointF offsetPixel = new PointF(Constants.MilimeterXToPixel(offsetMili.X), Constants.MilimeterYToPixel(offsetMili.Y));
        public static Point backBufferSize = new Point((int)(190 * pixelPerMili.X), (int)(200 * pixelPerMili.Y));
        public static Font f = new System.Drawing.Font("Arial", 5, FontStyle.Regular, GraphicsUnit.Millimeter);
        public static Font TenPixelFont = new System.Drawing.Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Millimeter);

        public static string serverName = "localhost";
        public static string usernameSQL = "root";
        public static string passwordSQL = "";
        public static string databaseName = "3trust_hubud_lisensi_new";
        public static string server_pusat = "localhost";
        public static BookCollection collections = BookCollection.Load(Properties.Resources.collectionsFilename);

        public static float PixelXToMilimeter(float pixelX)
        {
            return (pixelX/pixelPerMili.X);
        }

        public static float PixelYToMilimeter(float pixelY)
        {
            return (pixelY / pixelPerMili.Y);
        }

        public static float MilimeterXToPixel(float mm)
        {
            return (mm * pixelPerMili.X); 
        }

        public static float MilimeterYToPixel(float mm)
        {
            return (mm * pixelPerMili.Y); 
        }

        public static string port  { get; set; }
    }
}
